package com.baidu.shop.config;

/**
 * @Description:
 * @ClassName: AlipayConfig
 * @Author: User
 * @date: 2020.10.22 15:10
 * @version: 1.0
 */
import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016102600766481";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC3VNXoYa7llKc24LcbkFpkBjvt6Polk3+VATotOm10bRZ11v7SgPz9FZT69JACBiZbqp39sNLovPFxyZb+AaCN55yR/gtGYKVRR0tP3Wjw6fZQ8HQEYOFdK8BY8GkA+dzypKQsyfeSqL3AyEQOsjUl9H6mGrOTJP3zEkhMUSBOT3/yIfD6wz2FSgo3AGai1fnT/5N2D9nAd1MfHD2MJI49WaDz03A08L9NAqBssI8NtffcLfU4pgY2b4jpwfy6swkRkzfnoz7Aqkpyc+Tw70ChSrleMCuAkI6/DeBPdTuU2EFxg4saU1nBNPAucUDJrsVCh8Of0Ei3eAhDr1j9MthxAgMBAAECggEAEgsFanOCtRGmS15eZxYT71g1ubp+NAiKO+38/cqMTzMVTM+2EJ2lSHtBSFmderWEPO1T00390+4UjTBb7e/XD2BGJpAsJ+cHHjK4FMojs+Iy3dBseqnWREc0DQzMKM5ukmrlxYqzFPoKgtiy6gdb97pSZKKoHck8PRoFh41McqhxX0DuPOxDOpIVqwaatZQCJgFUAQuOI5x3vlOgaT0IT8OR+sGqTcz+TiY+K0Gi5SMCv/zoSK/FajbXEHxSpa2voO+Jy5AQXnNQARmWvxYw2sjkg9EKZcK+OuNm0FMIbXO9aRWqICyWz2HhoBgGjxfIpiP3NY26JKnkSBOQR9nyqQKBgQD2Lpt4A60c/46HtvQsJr7OFfQIoVfXlVX5c/0kLUumkw1JxIUUSpUsk2SRZZF54mLrWCpXTPQqz5zHLEcDe5W8VdwXaWkct9mJ+p6D8Ylh1mt7YDcKn9r5EPGcXUWLjGwr4atTnfqBaxNt1dnxS9QjlrYsIY6zehtp+D3CJN/hUwKBgQC+pI4c+EHb/AkiP2v4l5tZYp7KozQIPAObwqSWM16E4pVNAt4S6D4KJXkOGFrFM/sFaUbXP8F9p5ZMSOVMMswfJQGOY/U75FA3wnd6h/kznF2QM5J7VsgATUgYTEnaZwlNLKgQhEG02tOY+GWDcObJcYeOYjKr7UQhv73Hm4KSqwKBgHfLeEXvbAcHaMEryyfM9t5sGmM0t/0lI0APLCi1jfGR705tPeEA5hRZ6P9DsIXiHwas0XXH8az/eCgHqMrOEbAjC8WsusSJxmb5OLe2Coc8gvL3f/FAlprKnvfa/2OHwn+cAfXfky30//BbtwFPR/zFcwKIldtKWRq4/LyDmxoXAoGANCm6aNrUymhv51sLI/33l8GQSUnWlto08o2TkzWDC0EkMOoz8WByeTw/n0eyrnrGmHhx1buwKb2NNlpLw0my6GKrxlY7Z6PU/yzKnFBQM3r5btdtoSnhl5ONwng9TPEcbm1lnv9RKzck5powzII746qYuLDNxJUrK0DXoKJAW/kCgYAN+Jhk+uWNGqXj8OVDsY2WJPeoUjfHGBrh/5ReMnE0qerrHxHG6dy8X3JWadSCVV0+S74IODrzuBX+ZROGeovMqSKAmiyEXJGvJWUyS5Hrxg6ngjNngLlpGPARKPlApfW2j/yvS5dKfN7KdztWirQ5yPy9xDCy1AVvvUFjTRZAOw==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg2TubhZQKTsRKBOO539SmC8lXyplz9+4lYG3iQCVwAHwUmwGLTodAeL60oZBJYK3X4WQ8Dx34e275zUqJrGFRXhCMCvdrCqUQwSPD8/QZrAs0c47lnULlaAHyitr6AI+aV5L3RDnAjLcF5IF21Snz+CWaPW/va4r4Xpqen5EYK4KGHKUlR28mVxnId6V1vwPuwTzT47XuZe7TDAh6mnDdedsm0lTvzABU+2LZ3dTex/zrlV2Uehv4g58rQ0tFZDKlgSO1J8PXXQ9XA5C7Nz2A2snTD/5iVjyi0nGl0CCC8vAHxIjoQ/w/OdPCG5M6QSWnWmTiwg5rhLBgX2VrkMhdQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8900/pay/notify";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8900/pay/return";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}


